home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / bbs_util / nef234.zip / FEATURE / NEFEAT.H < prev   
C/C++ Source or Header  |  1996-03-05  |  6KB  |  151 lines

  1. /*****************************************************************************/
  2. /*                                                                           */
  3. /*                 (C) Copyright 1991-1996  Alberto Pasquale                 */
  4. /*                                                                           */
  5. /*                   A L L   R I G H T S   R E S E R V E D                   */
  6. /*                                                                           */
  7. /*****************************************************************************/
  8. /*                                                                           */
  9. /*   How to contact the author:  Alberto Pasquale of 2:332/504@fidonet       */
  10. /*                               alberto.pasquale@mo.nettuno.it              */
  11. /*                               Viale Verdi 106                             */
  12. /*                               41100 Modena                                */
  13. /*                               Italy                                       */
  14. /*                                                                           */
  15. /*****************************************************************************/
  16.  
  17. // NeFeat.H
  18.  
  19. // This include file is for use by the developers who want to write a
  20. // Feature DLL for NEF.
  21.  
  22. // In the case you _really_ need some "wider" interface to NEF,
  23. // please feel free to ask the author.
  24.  
  25.  
  26. #ifndef _NEFEAT_H_
  27. #define _NEFEAT_H_
  28.  
  29. #include <os2def.h>
  30.  
  31.                 // for dest of FeatOut, bitwise
  32.  
  33. #define FO_LOG  0x01 // send output to the log
  34. #define FO_CRT  0x02 // send output to the screen
  35. #define FO_BOTH 0x03 // send output to both log and screen
  36.  
  37. typedef VOID (* APIENTRY FeatOut) (UCHAR dest, CHAR prty, PCSZ format, ...);
  38.  
  39. // Function to write output to screen and/or log.
  40. // prty is the log priority char, usually one of "!*#: ".
  41. // prty is ignored for output to screen.
  42. // format and ... are the formatting string and parameters as in printf.
  43. // Heading and trailing \n are ignored for log entry.
  44.  
  45.  
  46. APIRET APIENTRY Init (FeatOut prnf);
  47.  
  48. #define NFI_OK  0x00000000      // Normal termination
  49. #define NFI_ERR 0x00000001      // Initialization error
  50.  
  51. // Mandatory.
  52. // This function is called during cfg file parsing, when the
  53. // FeatureLoad statement is encountered and the DLL loaded.
  54. // The prnf function pointer can be used to output messages to
  55. // screen and log file.
  56. // Must return NFI_OK on successful initialization.
  57.  
  58.  
  59. APIRET APIENTRY ParseCfg (PCSZ clnline);
  60.  
  61. #define NFP_OK  0x00000000      // Normal termination
  62. #define NFP_ERR 0x00000001      // Fatal Cfg Error
  63.  
  64. // This function is called by NEF when it finds a "Feature" configuration
  65. // statement.  The entire line, after the "Feature" statement, is passed
  66. // via the clnline pointer.
  67. // This string is guaranteed without tabs, comments,
  68. // trailing space and newline.
  69. // This function must normally return NFP_OK.
  70. // If NEF must exit with a "Cfg Error" errorlevel, this function
  71. // must return NFP_ERR.
  72. // In any case this function might use the prnf function to write
  73. // something to the screen and log file.
  74.  
  75.  
  76. APIRET APIENTRY BeforeNefToss (PCSZ fullname, PCSZ Tag, PCSZ Desc);
  77.  
  78. #define BNT_OK  0x00000000      // Normal termination
  79. #define BNT_BAD 0x00000001      // TIC must be renamed BAD
  80.  
  81. // This function is called after NEF has parsed the TIC file, before
  82. // it starts tossing the associated file.
  83.  
  84. // PCSZ fullname    Complete name (with path) of the file.
  85. // PCSZ Tag         Area Tag.
  86. // PCSZ Desc        Description for the file, as for announcements.
  87. //                  Multiple lines are separated by '\r'.
  88. // This function should normally return BNT_OK;
  89. // if the file must be processed as BAD, return BNT_BAD.
  90.  
  91.  
  92. typedef struct {
  93.     USHORT zone;
  94.     USHORT net;
  95.     USHORT node;
  96.     USHORT point;
  97. } _ADR;
  98.  
  99.  
  100. // structure with TIC data to be used (not modified) by AfterNefToss.
  101.  
  102. // Please note that all the strings containing lines from TICs (desc,
  103. // ldesc etc.) are a simple concatenation of the TIC lines, including
  104. // the heading keyword and terminating '\n'.
  105.  
  106. // The string pointers are never NULL: if there is no entry, they point
  107. // to an empty string.
  108.  
  109.             // definitions for the bits of the flags field.
  110.  
  111. #define TDF_CRCused     0x0001      // crc field is valid
  112. #define TDF_PassThru    0x0002      // The area is Pass Through
  113. #define TDF_NewArea     0x0004      // The area has just been created
  114.  
  115.  
  116. typedef struct {
  117.     USHORT  struct_size;        // Size of this structure.
  118.     USHORT  flags;              // Misc flags.
  119.     PCSZ    areatag;            // Area TAG.
  120.     PCSZ    areapath;           // Area path, terminated by '\'.
  121.     PCSZ    file;               // File name (no path).
  122.     PCSZ    replaces;           // File to be replaced.
  123.     LONG    size;               // Size of file.
  124.     ULONG   crc;                // CRC32 of file.
  125.     _ADR    from;               // System we received the file from.
  126.     _ADR    origin;             // System that hatched the file.
  127.     PCSZ    pwd;                // Password.
  128.     PCSZ    adesc;              // Description for announcement,
  129.                                 // lines separated by '\r'.
  130.     PCSZ    desc;               // "Desc" lines.
  131.     PCSZ    ldesc;              // "LDesc" lines.
  132.     PCSZ    path;               // "Path" lines.
  133.     PCSZ    seenby;             // "Seenby" lines.
  134.     PCSZ    unknown;            // Unrecognized lines.
  135. } _TICDATA;
  136.  
  137.  
  138. APIRET APIENTRY AfterNefToss (_TICDATA *td);
  139.  
  140. #define ANT_OK          0x00000000  // normal termination.
  141. #define ANT_NoFilesBbs  0x00000001  // do not update files.bbs.
  142. #define ANT_NoAnnounce  0x00000002  // do not announce this file.
  143.  
  144. // This function is called after NEF has tossed the file, before
  145. // it updates the files.bbs entry.
  146.  
  147. // The value returned by this function is to be processed as a group of
  148. // bitwise flags.
  149.  
  150. #endif
  151.